package com.skyolder.crutch.word.raw;

import java.io.IOException;

import com.skyolder.crutch.error.EofError;
import com.skyolder.crutch.error.GrammarError;

public class CharPiper {
	private CharReader charReader=null; 
	public CharPiper(CharReader charReader){
		this.charReader=charReader;	
	}
	public char nextChar() throws GrammarError {
		Character c=null;
		try {
			c = charReader.nextChar();
		} catch (IOException e) {
			throw new GrammarError(e.getMessage());
		}
		if(c==null){
			throw EofError.instance;
		}
		return c;
	}

}
